package com.app.songbump;

import android.app.TabActivity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.widget.TabHost;

@SuppressWarnings("deprecation")
public class SongBumpTabActivity extends TabActivity{
	AppPreferences appPrefs;
	
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.song_bump_tab);
	    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
	    appPrefs = new AppPreferences(getApplicationContext());
	    
	    //Resources res = getResources(); // Resource object to get Drawables
	    TabHost tabHost = getTabHost();  // The activity TabHost
	    TabHost.TabSpec spec;  // Resusable TabSpec for each tab
	    Intent intent;  // Reusable Intent for each tab
	    Bundle b = getIntent().getExtras();
	    String myIp = b.getString("ip");
	    // Create an Intent to launch an Activity for the tab (to be reused)
	    intent = new Intent().setClass(this, SongBumpMusicActivity.class);
	    Bundle c = new Bundle();
	    c.putString("ip", myIp);
	    intent.putExtras(c);

	    String someString = appPrefs.getUserName();
	    // Initialize a TabSpec for each tab and add it to the TabHost
	    spec = tabHost.newTabSpec("music").setIndicator(someString+"'s Music").setContent(intent);
	    tabHost.addTab(spec);

	    // Do the same for the other tabs
	    intent = new Intent().setClass(this, SongBumpFriendsActivity.class);
	    spec = tabHost.newTabSpec("friends").setIndicator(someString+"'s Friends").setContent(intent);
	    tabHost.addTab(spec);

	  

	    tabHost.setCurrentTab(0);
	}
}
